﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bymed.SpineScan.WPF.Model;
using Bymed.SpineScan.Service.Shared;
using Bymed.SpineScan.DataModel;

namespace Bymed.SpineScan.WPF.ViewModel.TestItemViewModel
{
    public class TestItemKyphosisViewModel : SingleTestItemViewModel
    {
        /// <summary>
        /// Initializes a new instance of the TestItemKyphosisViewModel class.
        /// </summary>
        public TestItemKyphosisViewModel(IDataService dataService)
            : base(dataService) { }

        public override void SetFormattedTestResult()
        {
            if (SecondTestResult.HasValue)
            {
                FormattedTestResult = SecondTestResult + "°";
            }
        }

        public override bool CheckIfTestFinished()
        {
            if (string.IsNullOrEmpty(FormattedTestResult))
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        /// <summary>
        /// Initialize all necessary parameters.
        /// Is is invoked by base constructor.
        /// </summary>
        protected override void InitializeParameters()
        {
            TestItemTitle = "脊柱后凸";
            TestItemName = TestItemDefinition.KyphosisTestName;
            FirstTestResultLabel = string.Empty;
            SecondTestResultLabel = string.Empty;
            FirstRangeStartValue = 20;
            SecondRangeStartValue = 20;
            FirstRangeEndValue = 40;
            SecondRangeEndValue = 40;
            FirstMaxValue = 140;
            SecondMaxValue = 140;
        }
    }
}
